home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-037.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  44.7 KB  |  1,375 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Sun, 29 Mar 92       Volume 1 : Issue 37
  2.  
  3. Today's Topics:
  4.  
  5.     Real-->String
  6.     MPW Shell command line?
  7.     Think C 4.0 -> 5.0 ?
  8.     MABuild target folder fun (MacApp 2.0.1)
  9.     Mac Pascal CWindowPtr question
  10.     MacTCP and BSD sockets.
  11.     Help with Think Pascal for a beginner?
  12.     Help Me Write The Perfect Editor
  13.     MPW questions
  14.     Passing args to argc, argv[], and env[]
  15.     MIDI source code and programming
  16.     _Launch & Working Directories
  17.     ListBox problems in Modal Dialog (II)
  18.  
  19.  
  20. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  21.  
  22. These digests are available (by using FTP, account anonymous, your email
  23. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  24. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  25. Questions list.
  26.  
  27. These digests are also available via email.  Just send a note saying that you
  28. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  29. automatically receive each new digest as it is created.
  30.  
  31. The articles in these digests are taken directly from comp.sys.mac.programmer.
  32. They are not edited; all articles included in this digest are in their original
  33. posted form.  The only articles that are -not- included in these digests are
  34. those which didn't receive any replies (except those that give information
  35. rather than ask a question).  All replies to each article are concatenated
  36. onto the original article in the order in which they were received.  Article
  37. threads are not added to the digests until the last article added to the
  38. thread is at least one month old (this is to ensure that the thread is dead
  39. before adding it to the digests).
  40.  
  41. Send administrative mail to mkelly@cs.uoregon.edu.
  42.  
  43. -------------------------------------------------------
  44.  
  45. From: cent@u.washington.edu (Bob Cent)
  46. Subject: Real-->String
  47. Date: 26 Feb 92 01:52:46 GMT
  48. Organization: University of Washington
  49.  
  50. Greetings,
  51.  
  52. I want to convert a Pascal SINGLE type to STR255.  Is there a function or
  53. procedure like the toolbox's NumToString (longint-->str255) for single type
  54. numbers?  (I'm using Think Pascal and MacApp)
  55.  
  56. Thanks.
  57.  
  58. Bob Cent
  59. cent@u.washington.edu
  60. Seattle, Washington
  61.  
  62.  
  63.  
  64. - -------------------------
  65.  
  66. From: lstein@athena.mit.edu (Lincoln Stein)
  67. Subject:  Real-->String
  68. Organization: Massachusetts Institute of Technology
  69. Date: Wed, 26 Feb 1992 12:26:01 GMT
  70.  
  71. > Is there a way to convert real numbers to strings in Think Pascal?
  72.  
  73. Check out the following code in the SANE.p interface file:
  74.  
  75. PROCEDURE Num2Str(f: decform;x: Extended;VAR s: DecStr);
  76. { s <-- x according to format f }
  77.  
  78. FUNCTION Str2Num(s: DecStr): Extended;
  79. { Str2Num <-- s }
  80.  
  81. I think that these routines will do the trick.
  82.  
  83. ===========================================================================
  84. Lincoln D. Stein            Brigham & Women's Hospital
  85. lstein@hstbme.mit.edu            Boston, MA
  86. ===========================================================================
  87.  
  88.  
  89.  
  90.  
  91. - -------------------------
  92.  
  93. From: Hyperion@Altyr4.gsfc.nasa.gov (Paul D. Haggerty)
  94. Subject:  Real-->String
  95. Date: 26 Feb 92 14:21:29 GMT
  96. Organization: Science Systems and Applications, Inc.
  97.  
  98. In article <1992Feb26.015246.17828@u.washington.edu>, cent@u.washington.edu  (Bob Cent) writes:
  99. > Greetings,
  100. > I want to convert a Pascal SINGLE type to STR255.  Is there a function or
  101. > procedure like the toolbox's NumToString (longint-->str255) for single type
  102. > numbers?  (I'm using Think Pascal and MacApp)
  103. > Thanks.
  104. > Bob Cent
  105. > cent@u.washington.edu
  106. > Seattle, Washington
  107. >  
  108.  
  109. Here's a conversion routines I use for translating between real's and strings.
  110.  
  111. Hope it helps.
  112.  
  113. Paul Haggerty
  114.  
  115. ** Note:  Personal responses should go to Haggerty@Suzieq.dnet.nasa.gov
  116.           DO NOT reply to the originating address above.  My Internet 
  117.           mailserver eats most of the mail it gets.
  118.  
  119.  
  120. ==============================================================================
  121.  
  122. {**}
  123. {*}
  124. {* Convert from an extended variable to a str255 string variable  using *}
  125. {* SANE's DecStr format. Note:  Function Currently Truncates the value  *}
  126. {* to 6 decimal places, and removes trailing 0's. *}
  127. {*}
  128. {**}
  129.  
  130. function ExtendedToString (TheValue: extended): str255;
  131.  var
  132.   ConversionString: DecStr;
  133.   ConversionForm: decForm;
  134.   Index: Integer;
  135. begin
  136.  ConversionForm.style := fixedDecimal;
  137. {Number of digits after the decimal}
  138.  ConversionForm.digits := 6;
  139.  num2Str(ConversionForm, TheValue, ConversionString);
  140. {Find last non-zero digit}
  141.  Index := Length(ConversionString);
  142.  while (Copy(ConversionString, Index, 1) = '0') do
  143.   index := index - 1;
  144. {Make sure you haven't backed up onto the decimal point}
  145.  if Copy(ConversionString, Index, 1) = '.' then
  146.   index := index + 1;
  147. {Extract pertinent part of string}
  148.  ConversionString := Copy(ConversionString, 1, Index);
  149.  ExtendedToString := ConversionString;
  150. end;
  151.  
  152.  
  153.  
  154. - -------------------------
  155.  
  156. From: ralph@madras.mso.anu.edu.au (Ralph Sutherland)
  157. Subject:  Real-->String
  158. Organization: Mt. Stromlo and Siding Spring Observatories
  159. Date: Wed, 26 Feb 92 14:36:19 GMT
  160.  
  161. Here are a couple of trivial wrappers I use for the 
  162. SANE conversion routines that make the conversions a little nicer
  163. to use:
  164.  
  165.     function FixStrof (x: extended; decimals: integer): str255;
  166.         var
  167.             f: DecForm;
  168.             s: DecStr;
  169.     begin
  170.  
  171.         f.style := FixedDecimal;
  172.         f.digits := decimals;
  173.         Num2Str(f, x, s);
  174.  
  175.         FixStrof := s;
  176.  
  177.     end;
  178.  
  179.     function FloatStrof (x: extended; decimals: integer): str255;
  180.         var
  181.             f: DecForm;
  182.             s: DecStr;
  183.     begin
  184.  
  185.         f.style := FloatDecimal;
  186.         f.digits := decimals;
  187.         Num2Str(f, x, s);
  188.  
  189.         FloatStrof := s;
  190.  
  191.     end;
  192.  
  193. In THINK Pascal there is a StringOf function that allows you to 
  194. use standard Pascal write formatting with the output to a string
  195. instead of a file.  When I moved to MPW I wrote these to replace
  196. StringOf, hence the similar names....
  197.  
  198. cheers
  199. ralph
  200.  
  201.  
  202.  
  203. -- 
  204. - -- Ralph S. Sutherland      Mount Stromlo & Siding Spring Observatories.
  205. - -- ralph@madras.anu.edu.au  The Australian National University.
  206. - -- rss100@cscgpo.anu.edu.au --------------------------------------------
  207.  
  208.  
  209.  
  210. ---------------------------
  211.  
  212. From: tagreen@bronze.ucs.indiana.edu (Todd Green)
  213. Subject: MPW Shell command line?
  214. Organization: Indiana University
  215. Date: Wed, 26 Feb 92 14:48:10 GMT
  216.  
  217. Hello,
  218.  
  219. I've recently been given the task to evaluate Obj-C running in the MPW
  220. environment. Being a THINK C programmer, I'm in the process of
  221. learning to use the MPW as well. (fun, fun).  Anyway I was wondering
  222. if anyone has written a tool for MPW, that would provide a command
  223. line, history, etc. that would run on top of the worksheet.  Sort of
  224. emulate csh, or tcsh.
  225.  
  226. Thanks,
  227. Todd
  228.  
  229.  
  230. -- 
  231. Internet: tagreen@bronze.ucs.indiana.edu
  232. NeXTMail: tagreen@marmoset.ucs.indiana.edu
  233. Bitnet:   tagreen@iubacs.bitnet
  234.  
  235.  
  236.  
  237. - -------------------------
  238.  
  239. From: Bruce.Hoult@bbs.actrix.gen.nz
  240. Subject:  MPW Shell command line?
  241. Date: 27 Feb 92 16:09:27 GMT
  242. Organization: Actrix Information Exchange
  243.  
  244. In article <1992Feb26.144810.10504@bronze.ucs.indiana.edu> tagreen@bronze.ucs.indiana.edu (Todd Green) writes:
  245. > Anyway I was wondering
  246. > if anyone has written a tool for MPW, that would provide a command
  247. > line, history, etc. that would run on top of the worksheet.  Sort of
  248. > emulate csh, or tcsh.
  249.  
  250. Why would anyone want a Un*x style history feature when they can *already*
  251. see every recent command they executed, and click in that line to execute
  252. it again?
  253.  
  254.  
  255. -- 
  256. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  257. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  258. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  259. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  260.  
  261.  
  262.  
  263. - -------------------------
  264.  
  265. From: tagreen@bronze.ucs.indiana.edu (Todd Green)
  266. Subject:  MPW Shell command line?
  267. Organization: Indiana University
  268. Date: Thu, 27 Feb 92 16:25:03 GMT
  269.  
  270. In article <1992Feb27.160927.3051@actrix.gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
  271.  
  272. >Why would anyone want a Un*x style history feature when they can *already*
  273. >see every recent command they executed, and click in that line to execute
  274. >it again?
  275. >
  276.  
  277. a) I don't like reaching for the mouse unless I have to.
  278. b) I don't like scrolling up through 10 pages of output to find the
  279.    one command that I want to execute again. (Which is faster: typing
  280.    "!<partial command>", or reaching for the mouse, scrolling up X pages
  281.    cliking on the line you want to execute, and then pressing
  282.    cmd-enter? (Or using a searching function to find the function that
  283.    you want to execute)
  284. c) If I have a bunch of commands that I want to execute, I'll put them
  285.    in a shell script and call it from the command line.  Which again
  286.    is much faster than reaching for your mouse hiliting a selection and 
  287.    then selecting enter.  (Yes, I know that MPW also has scripts)
  288.  
  289. I just find that I'm much more productive using a standard Unix type
  290. shell than I am using the MPW shell.
  291.  
  292. On a side note, how exactly does one read from Dev:StdIn (key strokes,
  293. not a selection) and directly assign the read key strokes to a shell
  294. variable?
  295.  
  296. Thanks again,
  297. Todd
  298.  
  299.  
  300. -- 
  301. Internet: tagreen@bronze.ucs.indiana.edu
  302. NeXTMail: tagreen@marmoset.ucs.indiana.edu
  303. Bitnet:   tagreen@iubacs.bitnet
  304.  
  305.  
  306.  
  307. ---------------------------
  308.  
  309. From: johnl@copper.ucs.indiana.edu (John Lacey)
  310. Subject: Think C 4.0 -> 5.0 ?
  311. Date: 26 Feb 92 19:42:00 GMT
  312. Organization: Indiana University
  313.  
  314. I have an application of about 5000 lines, and I was wondering how
  315. difficult this would be to port to the new TCL.  I use quite a lot of
  316. the classes, and I have about 15 subclasses, mainly of CPane,
  317. CDirector, and CWindow.
  318.  
  319. I haven't had good luck talking to Symantec in the past, but if anyone
  320. has had success discussing this issue with them, I would love to know
  321. who/where you talked to. :-)
  322.  
  323. -- 
  324. John Lacey, johnl@copper.ucs.indiana.edu                        ---Leo Tolstoy
  325. "Everyone thinks of changing the world, but no one thinks of changing himself."
  326.  
  327.  
  328.  
  329. - -------------------------
  330.  
  331. From: rla20@duts.ccc.amdahl.com (Roger Allen)
  332. Subject:  Think C 4.0 -> 5.0 ?
  333. Date: 26 Feb 92 23:15:59 GMT
  334. Organization: Amdahl Corporation, Sunnyvale CA
  335.  
  336. In article <1992Feb26.194209.1586@bronze.ucs.indiana.edu> johnl@copper.ucs.indiana.edu (John Lacey) writes:
  337. >I have an application of about 5000 lines, and I was wondering how
  338. >difficult this would be to port to the new TCL.  I use quite a lot of
  339. >the classes, and I have about 15 subclasses, mainly of CPane,
  340. >CDirector, and CWindow.
  341. >
  342.  
  343. I converted my program (~2000 lines) in a few evenings.  It would have
  344. taken about an hour to convert except for all the changes that I had
  345. to do for long coordinates.  This is by FAR the biggest pain.  Everything
  346. else was very straightforward.
  347.  
  348. If you don't deal with drawing too much you will be ok.  Although
  349. I can't imagine a Mac program that doesn't have a lot to do with drawing.
  350.  
  351. Just one example,
  352.  
  353. Roger.
  354.  
  355. P.S. Turn strict prototyping on.  Some of the initialization calls
  356.      changed and this will help.  I seem to recall InitApplication
  357.      changing.
  358. --
  359. > Roger Allen                   |  All the opinions expressed are my     <
  360. > Amdahl Computer Development   |  own and are not Amdahl's.             <
  361. > rla20@cd.amdahl.com           |  ------They paid me to say that------- <
  362.  
  363.  
  364.  
  365. ---------------------------
  366.  
  367. From: ednstras@kraken.itc.gu.edu.au (Michael Strasser)
  368. Subject: MABuild target folder fun (MacApp 2.0.1)
  369. Date: 27 Feb 92 01:38:25 GMT
  370. Organization: ITC, Griffith University, Brisbane, Australia
  371.  
  372. I just noticed today with MABuild in MacApp 2.0.1 that if you specify
  373.  
  374.     MABuild -Names -NoDebug Rhubarb
  375.  
  376. the target folder is set to "Garbage:crud:Rhubarb:.Non-Debug Files:", but 
  377. if you specify
  378.  
  379.     MABuild -NoDebug -Names Rhubarb
  380.  
  381. it is set to "Garbage:crud:Rhubarb:.NoDebug Names:" (names have been
  382. changed to protect the innocent).
  383.  
  384. Has anyone else found this?  Is it a feature?
  385. -- 
  386. Mike Strasser                       ednstras@kraken.itc.gu.edu.au.
  387. Education Division              or  M.Strasser@edn.gu.edu.au.
  388. Griffith University
  389. Brisbane, Australia
  390.  
  391.  
  392.  
  393. - -------------------------
  394.  
  395. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  396. Subject:  MABuild target folder fun (MacApp 2.0.1)
  397. Date: 27 Feb 92 04:11:23 GMT
  398. Organization: University of Illinois at Urbana
  399.  
  400. ednstras@kraken.itc.gu.edu.au (Michael Strasser) writes:
  401.  
  402. >I just noticed today with MABuild in MacApp 2.0.1 that if you specify
  403.  
  404. >    MABuild -Names -NoDebug Rhubarb
  405.  
  406. >the target folder is set to "Garbage:crud:Rhubarb:.Non-Debug Files:", but 
  407. >if you specify
  408.  
  409. >    MABuild -NoDebug -Names Rhubarb
  410.  
  411. >it is set to "Garbage:crud:Rhubarb:.NoDebug Names:" (names have been
  412. >changed to protect the innocent).
  413.  
  414. It's a feature -- separate build go in separate object folders (taking up lots
  415. of disk space :-) ), but methinks that giving folders names starting with
  416. periods and containing spaces is rather stupid.  Both of these cause problems
  417. for MPW: occaisonally doing an ls results in a wierd error about opening
  418. drivers (the . problem), and unless you are extremely carefull about using
  419. quotes in the makefile the spaces will get you sooner or later. I rename
  420. everything (actually I delete most of them and leave only 2 names...);
  421. see {MacApp}Startup.
  422.  
  423. -- 
  424. Mark Lanett                                                   mlanett@uiuc.edu
  425. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  426.  
  427.  
  428.  
  429. ---------------------------
  430.  
  431. From: stewartj@cae.wisc.edu (Stewart John)
  432. Subject: Mac Pascal CWindowPtr question
  433. Date: 27 Feb 92 05:43:04 GMT
  434. Organization: College of Engineering, Univ. of Wisconsin-Madison
  435.  
  436. I'm using THINK Pascal 4.0:
  437.  
  438. program biteme;
  439.  var
  440.   theWindow: CWindowPtr;
  441.   behind: CWindowPtr;
  442.   wStorage: Ptr;
  443.   windowID: integer;
  444. begin
  445.  windowID := 400;
  446.  wStorage := nil;
  447.  behind := CWindowPtr(WindowPtr(-1));
  448.  theWindow := GetNewCWindow(windowID, wStorage, behind);
  449. end.
  450.  
  451. Why the hell am I getting a "Type incompatability between an actual
  452. and formal parameter.  Seems to me things are as they should be 
  453. (see Inside Mac V:207).
  454.  
  455. If you have help, or want to flame me for a stupid question, send 
  456. E-mail:
  457.  
  458. stewartj@cae.wisc.edu
  459.  
  460. Thanks in advance
  461. John
  462.  
  463.  
  464.  
  465. - -------------------------
  466.  
  467. From: mxmora@unix.SRI.COM (Matt Mora)
  468. Subject:  Mac Pascal CWindowPtr question
  469. Date: 28 Feb 92 00:11:00 GMT
  470. Organization: SRI International, Menlo Park, California
  471.  
  472. In article <1992Feb26.234304.9985@doug.cae.wisc.edu> stewartj@cae.wisc.edu (Stewart John) writes:
  473.  
  474. > var
  475. >  theWindow: CWindowPtr;
  476. >  behind: CWindowPtr;
  477. >  wStorage: Ptr;
  478. >  windowID: integer;
  479. >begin
  480. > windowID := 400;
  481. > wStorage := nil;
  482. > behind := CWindowPtr(WindowPtr(-1));
  483. > theWindow := GetNewCWindow(windowID, wStorage, behind);
  484.  
  485. Try this:
  486.  
  487. theWindow := GetNewCWindow(windowID, nil, WindowPtr(-1));
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496. Matt
  497.  
  498. -- 
  499. ___________________________________________________________
  500. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  501. SRI International           |  my unix  mxmora@unix.sri.com
  502. ___________________________________________________________
  503.  
  504.  
  505.  
  506. - -------------------------
  507.  
  508. From: stewartj@cae.wisc.edu (Stewart John)
  509. Subject:  Mac Pascal CWindowPtr question
  510. Date: 28 Feb 92 04:14:52 GMT
  511. Organization: College of Engineering, Univ. of Wisconsin-Madison
  512.  
  513. In article <33131@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  514. >In article <1992Feb26.234304.9985@doug.cae.wisc.edu> writes:
  515. >
  516. >Try this:
  517. >
  518. >theWindow := GetNewCWindow(windowID, nil, WindowPtr(-1));
  519. >
  520. >Matt
  521.  
  522. Doesn't work.  I guess Inside Mac is wrong, and the function GetNewCWindow
  523. returns WindowPtr instead of CWindowPtr.  Anyway, it works now...
  524.  
  525. But I still can't get the damned color picture to display with DrawPicture!
  526. What else do you have to do???
  527.  
  528. John
  529. stewartj@cae.wisc.edu
  530.  
  531.  
  532.  
  533. ---------------------------
  534.  
  535. From: imran@Apple.COM (Imran Sayeed)
  536. Subject: MacTCP and BSD sockets.
  537. Date: 27 Feb 92 07:13:18 GMT
  538. Organization: Apple Computer Inc., Cupertino, CA
  539.  
  540. I am doing some MacTCP programming (actually I am thinking of implemeting
  541. BSD socket library on the Mac using MacTCP ) and am wondering if such 
  542. a library has already been written. Additionally I would like to get the 
  543. source code for NCSA Telnet (MacTCP version ) if it's available or some
  544. similar example application using MacTCP. If anybody has information on 
  545. either the socket library or the NCSA Telnet please e-mail me at 
  546. imran@apple.com or better ST601953@brownvm.brown.edu. Thanx a lot.
  547.  
  548. Imran  Sayeed.
  549.  
  550.  
  551.  
  552. - -------------------------
  553.  
  554. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  555. Subject:  MacTCP and BSD sockets.
  556. Date: 27 Feb 92 17:36:27 GMT
  557. Organization: University of Illinois at Urbana
  558.  
  559. imran@Apple.COM (Imran Sayeed) writes:
  560.  
  561. >I am doing some MacTCP programming (actually I am thinking of implemeting
  562. >BSD socket library on the Mac using MacTCP ) and am wondering if such 
  563. >a library has already been written. Additionally I would like to get the 
  564. >source code for NCSA Telnet (MacTCP version ) if it's available or some
  565. >similar example application using MacTCP. If anybody has information on 
  566. >either the socket library or the NCSA Telnet please e-mail me at 
  567. >imran@apple.com or better ST601953@brownvm.brown.edu. Thanx a lot.
  568.  
  569. Ahem. You *could* fetch Telnet from ftp.ncsa.uiuc.edu... Or you could fetch
  570. the BSD socket library that we've also written and save yourself quite
  571. a bit of time. It should be in the unsupported directory (*not* the Mac
  572. directory).
  573. -- 
  574. Mark Lanett                                                   mlanett@uiuc.edu
  575. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  576.  
  577.  
  578.  
  579. ---------------------------
  580.  
  581. From: fsmcs1@acad3.alaska.edu
  582. Subject: Help with Think Pascal for a beginner?
  583. Date: 27 Feb 92 09:40:39 GMT
  584. Organization: University of Alaska Fairbanks
  585.  
  586.  
  587.  
  588.  
  589.         Okay, okay, okay...  I know what you are all going to say.
  590. 'Get Inside Mac!'  Okay.  I'm working on it.  But since I can't 
  591. access any of the ftp sites (due to the fact I'm on a dumb terminal),
  592. I'd appreciate it if one of you programming moguls would spare the 
  593. time to give me some hints.
  594.         I'm not new to programming...  simply new to programming on
  595. the Mac.  I'm using a copy of Think Pascal (I have Think C, as well,
  596. but for my purposes, I prefer Pascal), and would like very much to 
  597. know how to open windows, draw icons, and use the pull-down menus to
  598. affect commands.  I'm a quick learner...  but I can't learn it without
  599. an example.  If someone could either write me a letter briefly describing
  600. the commands/prodecures/function calls required, or send me a copy of
  601. some insignificant source code that contains them, I'd truly appreciate
  602. it.  Like I said, I'm working on getting a copy of IM...  but it'll
  603. take me some time, and I'd rather get started now...  thanks for the
  604. information...
  605.  
  606.  
  607.  
  608. - -------------------------
  609.  
  610. From: rfischer@Xenon.Stanford.EDU (Ray Fischer)
  611. Subject:  Help with Think Pascal for a beginner?
  612. Date: 27 Feb 92 19:58:00 GMT
  613. Organization: Computer Science Department, Stanford University.
  614.  
  615. fsmcs1@acad3.alaska.edu writes ...
  616. >        I'm not new to programming...  simply new to programming on
  617. >the Mac.  I'm using a copy of Think Pascal (I have Think C, as well,
  618. >but for my purposes, I prefer Pascal), and would like very much to 
  619. >know how to open windows, draw icons, and use the pull-down menus to
  620. >affect commands.
  621.  
  622. If you buy Think C or Think Pascal you get lots of good examples
  623. for doing just this sort of thing (you did _buy_ your copies, didn't
  624. you?).  In addition to the sample code, there is also the class 
  625. library and ANSI libraries, thousands of lines of source code in all.
  626.  
  627. Inside Mac (which is sold in computer-related bookstores) is thousands
  628. of pages long.  I doubt many people are willing to summarize for you
  629. when Inside Mac volume I (which covers the starting basics of 
  630. windows, menus, and events) can be had for < $30 (published by
  631. Addison-Wesley, as is most of Apple's documentation).
  632.  
  633. SpinsideMac is the hypercard version and is available via ftp from
  634. Apple and probably several user groups such as BMUG.  Symantec also
  635. sells Think Reference (I think that's what it is called) which 
  636. summarizes Inside Mac online in a much nicer package than Spinside Mac.
  637.  
  638. Ray
  639. rfischer@cs.stanford.edu
  640.  
  641.  
  642.  
  643. - -------------------------
  644.  
  645. From: d88-jwa@byse.nada.kth.se (Jon W{tte)
  646. Subject:  Help with Think Pascal for a beginner?
  647. Date: 27 Feb 92 21:22:27 GMT
  648. Organization: Royal Institute of Technology, Stockholm, Sweden
  649.  
  650. .alaska.edu> fsmcs1@acad3.alaska.edu writes:
  651.  
  652.        I'm not new to programming...  simply new to programming on
  653.    the Mac.  I'm using a copy of Think Pascal (I have Think C, as well,
  654.    but for my purposes, I prefer Pascal), and would like very much to 
  655.    know how to open windows, draw icons, and use the pull-down menus to
  656.    affect commands.  I'm a quick learner...  but I can't learn it without
  657.    an example.  If someone could either write me a letter briefly describing
  658.  
  659. Wrong. You cannot learn without Inside Mac.
  660.  
  661. What's wrong with all the sample source that comes with Think Pascal
  662. and Think C ? From what I remember, they come with everything from
  663. "Hello, World !" to a full-fledged paint program written in the
  664. supplied object library. You still won't get far without Inside Mac.
  665. On paper.
  666.  
  667. There's also the Think Reference at $XX which contains most of IM I-V,
  668. and has hypertext links.
  669.  
  670. --
  671. This Signature is distributed under the conditions of the Signature License,
  672. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  673. implies that you accept to be bound by the terms in said License. Should you
  674. not agree on any of these terms, you must return the Signature unread to me.
  675.  
  676.  
  677.  
  678. - -------------------------
  679.  
  680. From: stewartj@cae.wisc.edu (Stewart John)
  681. Subject:  Help with Think Pascal for a beginner?
  682. Date: 28 Feb 92 04:22:14 GMT
  683. Organization: College of Engineering, Univ. of Wisconsin-Madison
  684.  
  685. >
  686. >       I'm not new to programming...  simply new to programming on
  687. >   the Mac.  I'm using a copy of Think Pascal (I have Think C, as well,
  688. >   but for my purposes, I prefer Pascal), and would like very much to 
  689. >   know how to open windows, draw icons, and use the pull-down menus to
  690. >   affect commands.  I'm a quick learner...  but I can't learn it without
  691. >   an example.  If someone could either write me a letter briefly describing
  692. >
  693.  
  694. Get "Macintosh Pascal Programming Primer: Inside the Macintosh Using THINK Pascal."
  695. By Dave Mark and Cartwright Reed.  Published by Addison-Wesley.
  696.  
  697. The single most helpful and valuable book I've ever seen to learning to 
  698. program on the Mac.  They take you step-by-step on how to use various features
  699. of the Toolbox.
  700.  
  701. John
  702. stewartj@cae.wisc.edu
  703.  
  704.  
  705.  
  706. ---------------------------
  707.  
  708. From: tange@daimi.aau.dk (Ole Tange)
  709. Subject: Help Me Write The Perfect Editor
  710. Date: 27 Feb 92 04:56:43 GMT
  711. Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
  712.  
  713. Since I sold my Amiga I havent seen a decent editor. On my Amiga I had
  714. Cygnus ED which I used all the time. But now when I am sitting at my IBM-clone
  715. I miss my CED.
  716.  
  717. At the university I use UNIX-machines and their editor is EMACS. As far as I
  718. know this editor is the most powerfull editor ever! BUT it is VERY user
  719. unfriendly! It has no menus and the help function is very cryptic, too - that
  720. is, when you are a EMACS-beginner like me.
  721.  
  722. So...
  723.  
  724. I decided to start a project called The Perfect Editor.
  725.  
  726. I want to make the best editor EVER! But I dont think I can do that on my own
  727. (I am still a novice programmer). So if you want to help me develop a public
  728. domain editor that is better that the commercial editors please mail me.
  729.  
  730. I got this idea because I saw FractInt and PV-Ray for my PC and these programs
  731. are so great that it seems impossible that they are public domain (but they
  732. ARE!).
  733.  
  734. If you want to join please mail me!
  735.  
  736. If you know a newsgroup where this note would be relevant (and you dont find
  737. it there) please re-post this article.
  738.  
  739. All my next postings (concerning PED) will go to: comp.editors
  740.  
  741.  
  742. !Ole Tange
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752. --
  753.         .:.=========================================================.:.
  754.       .:::::.               ANTE TEMPORE - ][T WAS                .:::::.
  755.     .:::::::::.Ole Tange, Noerre Alle 66B 3.3,  DK-8000 AArhus C.:::::::::.
  756.   .::Have Fun!::.        INTERNET: tange@daimi.aau.dk         .:::See Ya!:::.
  757.  
  758.  
  759.  
  760. - -------------------------
  761.  
  762. From: bskendig@tan.Princeton.EDU (Brian Kendig)
  763. Subject:  Help Me Write The Perfect Editor
  764. Date: 27 Feb 92 15:29:54 GMT
  765. Organization: Starfleet Academy, Princeton University
  766.  
  767. In article <1992Feb27.045643.7980@daimi.aau.dk> tange@daimi.aau.dk (Ole Tange) writes:
  768. >At the university I use UNIX-machines and their editor is EMACS. As far as I
  769. >know this editor is the most powerfull editor ever! BUT it is VERY user
  770. >unfriendly! It has no menus and the help function is very cryptic, too - that
  771. >is, when you are a EMACS-beginner like me.
  772. >So...
  773. >I decided to start a project called The Perfect Editor.
  774. >I want to make the best editor EVER!
  775.  
  776. Sorry, somebody beat you to it!  ;) It sounds like you're interested
  777. in writing a version of Emacs with menus and a help function for the
  778. Mac; the shareware program "Alpha" is exactly this.  You can get it
  779. from sumex-aim.stanford.edu and other fine ftp sites.
  780.  
  781. Now, if you manage to write the perfect _word processor_ instead of
  782. just a text editor, mankind just might beat a path to your door...
  783.  
  784.      << Brian >>
  785.  
  786. -- 
  787. | Brian S. Kendig       --/\-- Tri     bskendig@phoenix.Princeton.EDU, @PUCC
  788. | Computer Science BSE  |/  \| Quad  You gave your life to become the person
  789. | Princeton University  /____\ clubs    you are right now.  Was it worth it?
  790.  
  791.  
  792.  
  793. ---------------------------
  794.  
  795. From: long@mcntsh.enet.dec.com (Rich Long)
  796. Subject: MPW questions
  797. Date: 27 Feb 92 16:04:00 GMT
  798. Organization: Digital Equipment Corporation
  799.  
  800.  
  801.  I'm new to MPW (3.2), so I'd appreciate some help with some weird things I
  802.  can't figure out.
  803.  
  804.  1. How do I tell the Find command to look for a tab character?
  805.  
  806.  2. I have an Apple RGB monitor and a Radius TPD, to the right of it. The menu
  807.  bar is on the Apple; how can I force MPW to tile windows on the Radius? I've
  808.  played with the -r option on TileWindows and can't get it to work. MPW keeps
  809.  telling me "the specified rectangle is not allowed." It uses global
  810.  coordinates, right?
  811.  
  812.  3. What would be the script syntax for walking a directory and extracting the
  813.  file name portion of the path? For example, if I have a
  814.  "RCL:this:that:something else" path, and want the "something else" name into
  815.  a variable, how could I do this?
  816.  
  817.  Thank you!!
  818.  
  819. Richard C. Long            long@mcntsh.enet.dec.com
  820.               -or-    ...!decwrl!mcntsh.enet.dec.com!long           
  821.               -or-    long%mcntsh.dec@decwrl.enet.dec.com
  822.  
  823.  
  824.  
  825. - -------------------------
  826.  
  827. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  828. Subject:  MPW questions
  829. Date: 27 Feb 92 17:52:43 GMT
  830. Organization: University of Illinois at Urbana
  831.  
  832. long@mcntsh.enet.dec.com (Rich Long) writes:
  833.  
  834. > I'm new to MPW (3.2), so I'd appreciate some help with some weird things I
  835. > can't figure out.
  836.  
  837. > 1. How do I tell the Find command to look for a tab character?
  838.  
  839. >From the shell: search /6t/ <filenames>, where 6 is option-d (delta).
  840.  
  841. > 2. I have an Apple RGB monitor and a Radius TPD, to the right of it. The menu
  842. > bar is on the Apple; how can I force MPW to tile windows on the Radius? I've
  843. > played with the -r option on TileWindows and can't get it to work. MPW keeps
  844. > telling me "the specified rectangle is not allowed." It uses global
  845. > coordinates, right?
  846.  
  847. Beats me. I use SetKey to assign commands to my function keys to move
  848. the windows arround. For example:
  849.  
  850. SetKey F12    'MoveWindow 1049 -18 "{Active}"; SizeWindow 512 745 "{Active}"'
  851.  
  852. > 3. What would be the script syntax for walking a directory and extracting the
  853. > file name portion of the path? For example, if I have a
  854. > "RCL:this:that:something else" path, and want the "something else" name into
  855. > a variable, how could I do this?
  856.  
  857. I was going to post some of my code but it's not actually what you want, so
  858. I'll post some of Apple's instead (from Scripts:MergeBranch)
  859.  
  860.     If "{f}" =~ /(*)R1:(*)R2/ # {f} is the filename
  861.         Set dir "{R1}:"
  862.         Set f "{R2}"
  863.     Else
  864.         Set dir `directory`
  865.         If "{dir}" =~ /(*)R1:/
  866.             Set dir "{R1}:"
  867.         End
  868.     End
  869.  
  870. Where the R in R1 and R2 is really option-r, and * is really option-x.
  871. -- 
  872. Mark Lanett                                                   mlanett@uiuc.edu
  873. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  874.  
  875.  
  876.  
  877. - -------------------------
  878.  
  879. From: CXT105@psuvm.psu.edu (Christopher Tate)
  880. Subject:  MPW questions
  881. Date: 27 Feb 92 20:35:09 GMT
  882. Organization: Penn State University
  883.  
  884. In a completely trivial vein....
  885.  
  886. In article <1992Feb27.175243.8580@ux1.cso.uiuc.edu>, mlanett@void.ncsa.uiuc.edu
  887. (Mark Lanett) says:
  888. >
  889. > [searching for a tab character]
  890. >
  891. >From the shell: search /6t/ <filenames>, where 6 is option-d (delta).
  892.  
  893. Isn't that silly thing a "del" (partial derivative symbol), not a
  894. "for-real" lower-case delta?  I get confuzzed about these things
  895. as my caffeine:sleep ratio rises....
  896.  
  897. - -----
  898. Christopher Tate     | Cryptogram #17:
  899. cxt105@psuvm.psu.edu |
  900. CXT105@PSUVM.BITNET  | "NYO XFJ BCFGJ ZFJN MQWJVU EGYZ XQWBSGCJ.  QYT
  901. - -------------------|  ZOXQ HFMWCJXC NYO QFDC, EYG WJUMFJXC."
  902. Send me the answer!  |                  -- EGFJABWJ H. PYJCU
  903.  
  904.  
  905.  
  906. - -------------------------
  907.  
  908. From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
  909. Subject:  MPW questions
  910. Organization: University of Illinois at Urbana
  911. Date: Thu, 27 Feb 1992 22:01:56 GMT
  912.  
  913. Christopher Tate <CXT105@psuvm.psu.edu> writes:
  914.  
  915. >In a completely trivial vein....
  916.  
  917. >In article <1992Feb27.175243.8580@ux1.cso.uiuc.edu>, mlanett@void.ncsa.uiuc.edu
  918. >(Mark Lanett) says:
  919. >>
  920. >> [searching for a tab character]
  921. >>
  922. >>From the shell: search /6t/ <filenames>, where 6 is option-d (delta).
  923.  
  924. >Isn't that silly thing a "del" (partial derivative symbol), not a
  925. >"for-real" lower-case delta?  I get confuzzed about these things
  926. >as my caffeine:sleep ratio rises....
  927.  
  928. Whatever. If you want to avoid Apple-isms I suppose you would call it "the
  929. escape character" rather than by its greek name. What I want to know is,
  930. what do you call the option-x character? I just say "splat"; most people
  931. know what I mean. "Variable pattern matcher" seems excessive.
  932. >-------
  933. >Christopher Tate     | Cryptogram #17:
  934. >cxt105@psuvm.psu.edu |
  935. >CXT105@PSUVM.BITNET  | "NYO XFJ BCFGJ ZFJN MQWJVU EGYZ XQWBSGCJ.  QYT
  936. >---------------------|  ZOXQ HFMWCJXC NYO QFDC, EYG WJUMFJXC."
  937. >Send me the answer!  |                  -- EGFJABWJ H. PYJCU
  938. -- 
  939. Mark Lanett                                                   mlanett@uiuc.edu
  940. Software Tools Group, NCSA, University of Illinois at Urbana-Champaign
  941.  
  942.  
  943.  
  944. - -------------------------
  945.  
  946. From: anders@verity.com (Anders Wallgren)
  947. Subject:  MPW questions
  948. Organization: Verity, Inc., Mountain View, CA
  949. Date: Thu, 27 Feb 92 21:24:00 GMT
  950.  
  951. In article <33784@nntpd.lkg.dec.com>, long@mcntsh (Rich Long) writes:
  952. >
  953. > I'm new to MPW (3.2), so I'd appreciate some help with some weird things I
  954. > can't figure out.
  955. >
  956. > 1. How do I tell the Find command to look for a tab character?
  957.  
  958.  
  959. find /<opt-d>t/ "the window" # <opt-d> means press option-d
  960.  
  961. >
  962. > 3. What would be the script syntax for walking a directory and extracting the
  963. > file name portion of the path? For example, if I have a
  964. > "RCL:this:that:something else" path, and want the "something else" name into
  965. > a variable, how could I do this?
  966. >
  967.  
  968. if "foo:bar:something else" =~ /[a-zA-Z:_0-9]<opt-x>:([a-zA-Z_0-9]<opt-x>)<opt-r>1/ 
  969.     set variable "{<opt-r>1}"
  970. end
  971.  
  972.  
  973.  
  974.  
  975. - -------------------------
  976.  
  977. From: tjc@pacvax.pacersoft.com (Tom Colley)
  978. Subject:  MPW questions
  979. Date: 28 Feb 92 14:49:24 GMT
  980. Organization: Pacer Software, Inc.
  981.  
  982. In article <33784@nntpd.lkg.dec.com>, long@mcntsh.enet.dec.com (Rich Long) writes:
  983. >  I'm new to MPW (3.2), so I'd appreciate some help with some weird things I
  984. >  can't figure out.
  985. >  1. How do I tell the Find command to look for a tab character?
  986. >  2. ...
  987. >
  988. >  3. What would be the script syntax for walking a directory and extracting the
  989. >  file name portion of the path? For example, if I have a
  990. >  "RCL:this:that:something else" path, and want the "something else" name into
  991. >  a variable, how could I do this?
  992. >  Thank you!!
  993. > Richard C. Long            long@mcntsh.enet.dec.com
  994.  
  995. 1.  Copy a tab into the clipboard (from a document).  Select Find...  Then
  996.     Paste the tab into the text field.  Or, you could highlight (select) a
  997.     tab, and then hit Cmd-H (It's under the Find menu).
  998.  
  999. 2.  deferred
  1000.  
  1001. 3.  I think the evaluate line below is right from the MPW docs.  Put your
  1002.     path in the variable "fullpath".  Change the "R" to an option-r.
  1003.     Change the "X" to an option-x.  Change the "L" to an option-l (that
  1004.     is a lowercase "L", not a "1").  {dir_path} will contain the directory
  1005.     that the file is in, {leaf_name} will contain the leaf name.
  1006.  
  1007. Unset R1
  1008. ( Evaluate "{fullpath}" =~ /(([L:]*:)*)R1X/ ) > Dev:Null
  1009. Set dir_path "{R1}"
  1010. echo {dir_path}
  1011.  
  1012. Unset R1
  1013. ( Evaluate "{fullpath}" =~ /(([L:]*:)*)(X)R1/ ) > Dev:Null
  1014. Set leaf_name "{R1}"
  1015. echo {leaf_name}
  1016.  
  1017. Hope this helps.
  1018.  
  1019. Tom Colley
  1020. tjc@pacersoft.com     uunet!pacvax!tjc
  1021.  
  1022.  
  1023.  
  1024. - -------------------------
  1025.  
  1026. From: keith@Apple.COM (Keith Rollin)
  1027. Subject:  MPW questions
  1028. Date: 28 Feb 92 23:42:08 GMT
  1029. Organization: Apple Computer Inc., Cupertino, CA
  1030.  
  1031. In article <33784@nntpd.lkg.dec.com> long@mcntsh.enet.dec.com (Rich Long) writes:
  1032. >
  1033. > 2. I have an Apple RGB monitor and a Radius TPD, to the right of it. The menu
  1034. > bar is on the Apple; how can I force MPW to tile windows on the Radius? I've
  1035. > played with the -r option on TileWindows and can't get it to work. MPW keeps
  1036. > telling me "the specified rectangle is not allowed." It uses global
  1037. > coordinates, right?
  1038.  
  1039.  
  1040. Other people have answered the other two questions; I'll see if I can't
  1041. tackle this one. Warning: this is based on memory; I'm not in a
  1042. position to test out what follows.
  1043.  
  1044. First, keep in mind that the rectangle you specify applies to the
  1045. structure rectangle of the window. This is in contrast to Window
  1046. Manager routines like MoveWindow, which apply to the content rectangle.
  1047. (Actually, I just tried this out, and it seems to be true only of MPW's
  1048. MoveWindow command. SizeWindow seems to apply to the content rectangle
  1049. of the window, less the info bar and scrollbars.)
  1050.  
  1051. Second, MPW considers {0, 0} to be the point just below them menubar on
  1052. the left hand side of the main monitor. This means that the top left
  1053. corner of your monitor is {-20, 0}, according to MPW.
  1054.  
  1055. Finally, MPW doesn't seem to like your specifying screen rectangles
  1056. that fall outside of the gray region. For instance, the dimensions of
  1057. my 2-page display are 870 x 1152. However, I can't specify that as the
  1058. rectangle for TileWindows or ZoomWindow, as that rectangle falls into
  1059. the little rounded corners of my screen. I have to account for that by
  1060. subtracting a little bit from the dimensions of the screen. For tiling,
  1061. I think I specify a rectangle of top=1, left=2, bottom=828, right=1149.
  1062.  
  1063. -- 
  1064. - ----------------------------------------------------------------------------
  1065. Keith Rollin           ---            <Taligent .signature under construction>
  1066. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  1067.  
  1068.  
  1069.  
  1070. ---------------------------
  1071.  
  1072. From: hofmann@cs.uiuc.edu (J. Scott Hofmann)
  1073. Subject: Passing args to argc, argv[], and env[]
  1074. Organization: University of Illinois at Urbana
  1075. Date: Thu, 27 Feb 1992 16:05:12 GMT
  1076.  
  1077.    Sorry if I'm missing something extremely obvious, but under the Mac Finder,
  1078. how can arguments be passed to a program via argc, argv[], and env[]? I'm
  1079. doing a port of some Unix software to the Mac Finder and I need it to take
  1080. what were command line arguments from an opening dialogue.
  1081.  
  1082.                                                           Scott
  1083.  
  1084.  
  1085. -- 
  1086. - -----------------------------------------------------------------------------
  1087. J. Scott Hofmann                        | "Scientific Progress goes 'Boink'?"
  1088. hofmann@cs.uiuc.edu (NeXTmail accepted) |  -Hobbes
  1089. Calculus&Mathematica project            | Epoch development team, UIUC
  1090.  
  1091.  
  1092.  
  1093. - -------------------------
  1094.  
  1095. From: aland@chaos.cs.brandeis.edu (Alan D.)
  1096. Subject:  Passing args to argc, argv[], and env[]
  1097. Organization: As little as possible
  1098. Date: Fri, 28 Feb 1992 00:02:46 GMT
  1099.  
  1100. hofmann@cs.uiuc.edu (J. Scott Hofmann) writes:
  1101.  
  1102. >   Sorry if I'm missing something extremely obvious, but under the Mac Finder,
  1103. >how can arguments be passed to a program via argc, argv[], and env[]? I'm
  1104. >doing a port of some Unix software to the Mac Finder and I need it to take
  1105. >what were command line arguments from an opening dialogue.
  1106.  
  1107. Well, the 'extremely obvious' thing you are missing is the
  1108. specification of which Mac environment you are using.
  1109.  
  1110. If you're using Think C, you should check the User Manual for
  1111. "ccommand()" (I don't remember exactly what parameters, if any, it
  1112. takes -- But probably int argc, char **argv).
  1113.  
  1114. If you use MPW, you're on your own, as I've never seen a MPW manual.
  1115. But from what I have seen, "commando" works similarly to the Unix
  1116. shell.  As I said, you're on your own for a library function.
  1117.  
  1118. If need be, make up your own dialog box, with radio buttons for File,
  1119. Console input, and File, Console, Both output...  As Symantec did for
  1120. Think C...
  1121.  
  1122. Or make the first dialog of the program be a dialog which reads a
  1123. textedit string; have the user type the parameters.  You can even
  1124. store a default value for this string.
  1125.  
  1126. Good luck!
  1127.  
  1128.     -=Alan
  1129.  
  1130.  
  1131.  
  1132. ---------------------------
  1133.  
  1134. From: urritche@queen.mcs.drexel.edu (Ralph Paul Ritchey)
  1135. Subject: MIDI source code and programming
  1136. Date: 27 Feb 92 20:24:10 GMT
  1137. Organization: Drexel University
  1138.  
  1139. I am currently looking for good public domain MIDI software, source code, and
  1140. anyone else that is into programming MIDI applications on the Mac.  If anyone
  1141. knows where I might be able to find things pertaining to this, or if anyone
  1142. is interested in swapping ideas etc., please e-mail me.
  1143.  
  1144.  
  1145.         Ralph Ritchey
  1146.         urritche@mcs.drexel.edu
  1147.  
  1148.  
  1149.  
  1150. - -------------------------
  1151.  
  1152. From: Saeedi@cup.portal.com (Steven J Saeedi)
  1153. Subject:  MIDI source code and programming
  1154. Date: 28 Feb 92 01:13:21 GMT
  1155. Organization: The Portal System (TM)
  1156.  
  1157. >I am currently looking for good public domain MIDI software, source code, and
  1158. >anyone else that is into programming MIDI applications on the Mac.  If anyone
  1159. >knows where I might be able to find things pertaining to this, or if anyone
  1160. >is interested in swapping ideas etc., please e-mail me.
  1161.  
  1162. How does $35 sound?  Get the MIDI Manager from APDA and it includes 
  1163. all kinds of sample files on sequencing, etc.
  1164.  
  1165. -- Steve Saeedi
  1166. >
  1167. >
  1168. >        Ralph Ritchey
  1169. >        urritche@mcs.drexel.edu
  1170.  
  1171.  
  1172.  
  1173. ---------------------------
  1174.  
  1175. From: Joe.Francis@dartmouth.edu (Joe Francis)
  1176. Subject: _Launch & Working Directories
  1177. Date: 27 Feb 92 23:36:30 GMT
  1178. Organization: Dartmouth College, Hanover, NH
  1179.  
  1180. Context: systems 6.0.x, MultiFinder running
  1181.  
  1182. Question:  TN 126 says set WDProcID to 'ERIK' when opening a wd prior
  1183. to _Launch.  TN 190 says MultiFinder ignores WDProcID.  Who's right?
  1184.  
  1185. Note:  I get very strange behavoir if I just OpenWD, _Launch, and
  1186. CloseWD.  Namely, it becomes possible for HGetVol to return a wd that
  1187. GetWDInfo won't acknowledge as legitimate (this happens to me in the
  1188. HOpenresFile glue, of all places).  I think there is some confusion as
  1189. to what process owns the wd at this point.  Not calling CloseWD
  1190. alleviates the problem.
  1191.  
  1192. Should I abandon OpenWD, use PBOpenWD and set the WDProcID to 'ERIK'? 
  1193. If so, do I call CloseWD after _Launch?
  1194.  
  1195.  
  1196.  
  1197. - -------------------------
  1198.  
  1199. From: keith@Apple.COM (Keith Rollin)
  1200. Subject:  _Launch & Working Directories
  1201. Date: 28 Feb 92 23:50:49 GMT
  1202. Organization: Apple Computer Inc., Cupertino, CA
  1203.  
  1204. In article <1992Feb27.233630.6515@dartvax.dartmouth.edu> Joe.Francis@dartmouth.edu (Joe Francis) writes:
  1205. >Context: systems 6.0.x, MultiFinder running
  1206. >
  1207. >Question:  TN 126 says set WDProcID to 'ERIK' when opening a wd prior
  1208. >to _Launch.  TN 190 says MultiFinder ignores WDProcID.  Who's right?
  1209. >
  1210. >Note:  I get very strange behavoir if I just OpenWD, _Launch, and
  1211. >CloseWD.  Namely, it becomes possible for HGetVol to return a wd that
  1212. >GetWDInfo won't acknowledge as legitimate (this happens to me in the
  1213. >HOpenresFile glue, of all places).  I think there is some confusion as
  1214. >to what process owns the wd at this point.  Not calling CloseWD
  1215. >alleviates the problem.
  1216. >
  1217. >Should I abandon OpenWD, use PBOpenWD and set the WDProcID to 'ERIK'? 
  1218. >If so, do I call CloseWD after _Launch?
  1219.  
  1220. DO: Use 'ERIK' for the procID of the wd. This is a special case to the
  1221. paragraph in TN #190 that says MultiFinder ignores it.
  1222.  
  1223. DO NOT: Close the wd after you have launched the application. If you
  1224. do, then the just launched application no longer has a wd to work with
  1225. when it might expect one.
  1226.  
  1227. DO: Use the System 7 interface for launching application when it is
  1228. available. This avoids the hassles that you are experiencing.
  1229.  
  1230. -- 
  1231. - ----------------------------------------------------------------------------
  1232. Keith Rollin           ---            <Taligent .signature under construction>
  1233. Disclaimer: Pretty soon, I really _won't_ be speaking for Apple...
  1234.  
  1235.  
  1236.  
  1237. ---------------------------
  1238.  
  1239. From: mgraf@sydvm1.VNET.IBM.COM (Michael Graf)
  1240. Subject: ListBox problems in Modal Dialog (II)
  1241. Date: 28 Feb 92 15:24:32 GMT
  1242. Organization: Australian Programming Centre (IBMA)
  1243.  
  1244.  
  1245.     I am starting to play around with placing a List Box within a
  1246. Modal Dialog, using the Toolbox List Manager. Following the advice of those
  1247. few individuals who sent me code and samples, I have done what I think is
  1248. the right approach and have almost gotten it to work (thanx again to
  1249. those who helped/advised).
  1250.  
  1251.     However, I am having some annoying problems, which I assume must have
  1252. arisen for others before, and so I thought I'd ask the net's opinion.
  1253. Firstly, I am using Think Pascal 4.01 and have followed the following
  1254. code steps:
  1255.  
  1256.     1.  Defined user item in resource template
  1257.     2.  For modal dialog, got item Rect for user item, set it appropriately
  1258.      and called LNew, with both horizontal and vertical scroll bars
  1259.     3.  Drawn rectangle to make up 'list' appearance
  1260.     4.  Add 1 single column, with 5 rows to List
  1261.     5.  Used LSetCell to add strings to each of the five rows
  1262.     6.  Called LDoDraw before (and tried with after) showing the dialog
  1263.  
  1264.     The following problems arise:
  1265.         -   on displaying the dialog, none of my string entries are shown.
  1266.       If I scroll horizontally and then back, the strings are displayed.
  1267.       Do I need to specify some other 'update activity' apart from the
  1268.       LDoDraw ?
  1269.  
  1270.         -   the strings, when displayed are not shown correctly; they each
  1271.       have an extra byte (the standard 'box' character). I have used the
  1272.       following to set the text string (PTR) for LSetCell:
  1273.         VAR
  1274.             aTextPtr:   Ptr;
  1275.                 :::
  1276.             aTextPtr := NewPtr(length_of_theString);
  1277.             aTextPtr := @theString;
  1278.       What is causing this EXTRA byte to appear in the string ? Using the
  1279.       THINK step debugger, I can show that @theString matches the address
  1280.       set to aTextPtr, and that aTextPtr^ has the correct data.
  1281.  
  1282.         -   lastly, on quitting my program, THINK returns the following
  1283.       error:
  1284.             'System Zone is damaged. Proceed with caution.'
  1285.       What could possibly cause this ?
  1286.  
  1287.     Can anyone shed any light on the above situations ? I would greatly
  1288.     appreciate any words of wisdom, especially those which might enlighted
  1289.     me on what Pascal blunders I have committed.
  1290.  
  1291.     Thanx, in advance, for the help.
  1292.  
  1293. **********************************************************************
  1294. Regards,
  1295.   Michael Graf - humble novice programmer  (mgraf@sydvm1.vnet.ibm.com)
  1296. **********************************************************************
  1297.  
  1298.  
  1299.  
  1300. - -------------------------
  1301.  
  1302. From: mxmora@unix.SRI.COM (Matt Mora)
  1303. Subject:  ListBox problems in Modal Dialog (II)
  1304. Date: 28 Feb 92 18:11:42 GMT
  1305. Organization: SRI International, Menlo Park, California
  1306.  
  1307. In article <9202280026.AA27190@ucbvax.Berkeley.EDU> mgraf@sydvm1.VNET.IBM.COM (Michael Graf) writes:
  1308.  
  1309. >    The following problems arise:
  1310. >        -   on displaying the dialog, none of my string entries are shown.
  1311. >      If I scroll horizontally and then back, the strings are displayed.
  1312. >      Do I need to specify some other 'update activity' apart from the
  1313. >      LDoDraw ?
  1314.  
  1315. in your filterproc don't forget to add LUpdate(redraw, list);
  1316.  
  1317. >        -   the strings, when displayed are not shown correctly; they each
  1318. >      have an extra byte (the standard 'box' character). I have used the
  1319. >      following to set the text string (PTR) for LSetCell:
  1320. >        VAR
  1321. >            aTextPtr:   Ptr;
  1322. >                :::
  1323. >            aTextPtr := NewPtr(length_of_theString);
  1324. >            aTextPtr := @theString;
  1325.  
  1326. All that code is too much work. (plus you are creating a new ptr
  1327. for no reason)
  1328.  
  1329. Try:
  1330.  
  1331.     LSetCell(ptr(ord(@theString)+1), length(theString),theCell,mylist);
  1332.  
  1333. You are adding the length byte in the cell. In the above code we skip the 
  1334. length byte and just add the string.
  1335.  
  1336. >
  1337. >        -   lastly, on quitting my program, THINK returns the following
  1338. >      error:
  1339. >            'System Zone is damaged. Proceed with caution.'
  1340. >      What could possibly cause this ?
  1341.  
  1342. This usally happens if you are using a bad handle (or ptr) and you
  1343. are trashing memory somewhere. A common problem with using the list
  1344. manager (since it return no errors) is that you are stuffing too
  1345. much data in to the list. (not likely in you case since you only have
  1346. five rows). Remember not to stuff more than 32k of data into the list.
  1347.  
  1348.  
  1349. That should do it.
  1350.  
  1351. Good Luck
  1352.  
  1353.  
  1354. Matt
  1355. -- 
  1356. ___________________________________________________________
  1357. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  1358. SRI International           |  my unix  mxmora@unix.sri.com
  1359. ___________________________________________________________
  1360.  
  1361.  
  1362.  
  1363. ---------------------------
  1364.  
  1365. End of C.S.M.P. Digest
  1366. **********************
  1367.